# -*- coding: utf-8 -*-
"""
@Time ： 2024/10/14 10:33
@Auth ： 刘佳
@File ：zconfig.py
@IDE ：PyCharm
@Motto:自定义配置文件
"""
SETTING = {
    # 正式机False,开发机True
    'DEBUG':False,
    # 数据库地址
    # 'DBURL':{'DEV':'localhost','PRD':'172.30.0.35'},
    'DBURL':{'DEV':'localhost','PRD':'10.1.0.128'},#地址更换
    'WEBURL':{'DEV':'http://127.0.0.1:8000','PRD':'http://10.1.0.128:8088'},#网站地址
    # 本地连接地址
    'CDPURL':'http://127.0.0.1:9333',
    #自动任务URLL
    'TASK_URL':{'SJZLR':'https://sycm.taobao.com/portal/home.htm',
                'LLLYDPR':'https://sycm.taobao.com/flow/monitor/shopsource/construction?activeKey=item&belong=all&dateRange=',
                'ZTR':'https://one.alimama.com/index.html#!/report/item_promotion?rptType=item_promotion&curTemplateId=',
                'SJZL':'https://sycm.taobao.com/portal/home.htm',
                'HXGK':'https://sycm.taobao.com/cc/item_archives?activeKey=sale&dateRange=',
                'HXGKR':'https://sycm.taobao.com/cc/item_rank?dateRange=',#淘宝下载全部商品核心概况数据地址
                'LLLY':'https://sycm.taobao.com/cc/item_archives?activeKey=flow&dateRange=',
                'YXCJ':'https://one.alimama.com/index.html#!/report/account?rptType=account&startTime=',
                'JH':'https://one.alimama.com/index.html#!/report/campaign?rptType=campaign&startTime=',
                'JDSJZLR':'https://ppzh.jd.com/brandweb/brand/view/dealAnalysis/dealSummary.html',
                'JDSJZLRPOP':'https://sz.jd.com/sz/view/dealAnalysis/dealSummarys.html',
                'JDLLLYDPR':'https://ppzh.jd.com/brandweb/brand/view/viewflow/mvpSummary.html',
                'JDLLLYDPRPOP':'https://sz.jd.com/szweb/sz/view/viewflow/viewSourcesVNew.html',
                'JDYXCJR':'https://jzt.jd.com/custom-report/#/overview',
                'JDYXCJRNEW':'https://ppzh.jd.com/brand/marketingAnalysis/advertSummary.html',
                'JDYXCJRNEWBX':'https://sz.jd.com/sz/view/marketingTool/advertSummary.html',
                'JDHXGKR':'https://ppzh.jd.com/brand/reportCenter/recommendReport.html',
                'JDLLLYR':'https://ppzh.jd.com/brandweb/brand/view/viewflow/mvpSummary.html',
                # 'JDZTR':'https://jzt.jd.com/jdkc/survey.html#/normal_v3/list',
                'JDZTR':'https://jzt.jd.com/msa/#/list/tab/plan?objective=overview',
                'JDZTRNEW':'https://jzt.jd.com/jdkc/survey.html#/normal_v3/list',

                'PDDLOGIN':'https://mms.pinduoduo.com/login/',
                'PDDYXCJ':'https://yingxiao.pinduoduo.com/goods/report/promotion/overView?beginDate=',
                'PDDYXCJ2':'https://yingxiao.pinduoduo.com/starmall/report/overView?beginDate=',
                'PDDSJZLR':'https://mms.pinduoduo.com/sycm/search_data/plate',
                'PDDKFR':'https://mms.pinduoduo.com/mms-chat/overview/service',
                'PDDTKR':'https://mms.pinduoduo.com/sycm/stores_data/operation?dateFlag=0',
                'PDDZTR':'https://yingxiao.pinduoduo.com/goods/report/promotion/overView?msfrom=mms_sidenav&scenesMode=1&beginDate=',
                'PDDHXGKR':'https://mms.pinduoduo.com/sycm/goods_effect?msfrom=mms_sidenav',
                'PDDDDJBR':'https://mms.pinduoduo.com/jinbao/goodsEffect',

                'DOWNLOAD':'https://one.alimama.com/index.html#!/report/download-list',
                'JDDOWNLOAD':'https://jzt.jd.com/custom-report/#/download',
                'JDZTRDOWNLOAD':'https://jzt.jd.com/jdkc/survey.html#/report/download',
                'JDREPORT':'https://ppzh.jd.com/brand/reportCenter/myReport.html',

                #企业微信审批流待处理人任务下载地址
                'QYWXSP':'https://work.weixin.qq.com/wework_admin/frame#approval_v2/handover/working',
                'QWLOGINURL':'https://work.weixin.qq.com/wework_admin/loginpage_wx?from=myhome',
                'QWTASKURL':'https://work.weixin.qq.com/wework_admin/frame#/approval_v2/handover/working'
                },
    #启动谷歌浏览器的exe位置
    'START_CHROME':{'DEVPATH':r' --remote-debugging-port=9333 --user-data-dir=C:\new\AutomationProfile',
                    'PRDPATH':r' --remote-debugging-port=9333 --user-data-dir=C:\new\AutomationProfile'},
    #自动任务运行间隔/秒
    'TASK_INTERVAL':{'TB_TASK':1800},
    #视觉识别
    'OCR':{
            'W64':"https://api.hanximeng.com/lanzou/?url=https://liujia8080.lanzouo.com/iFxuR2qc079c&type=down&pwd=f2x7",
            'W32':"https://api.hanximeng.com/lanzou/?url=https://liujia8080.lanzouo.com/iebv72qc0nkj&type=down&pwd=gy4j"
           },
    'TESSERACT':{
        'TESSERACT_IMG':'download\img',
        'TESSERACT_PATH':'download\OCR',
        'TESSERACT_EXE':'tesseract.exe',
        'TESSDATA_PATH':'tessdata',
        'TESSDATA_NAME':'eng.traineddata',
    }

}

def get_setting(key, default=None):
    '''
    获取自定义配置
    :param key: 配置字段
    :param default:
    :return:
    '''
    return SETTING.get(key, default)